// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import store from "./store"

//导入模块
import VueAwesomeSwiper from "vue-awesome-swiper"

//导入全局组件
import BottomNavBar from "./globalComponents/BottomNavBar.vue"
import TopSearch from "./globalComponents/TopSearch.vue"
import SingleGuess from "./globalComponents/SingleGuess"

//导入全局过滤器
import {dataFormat} from "./filters/filters"

Vue.config.productionTip = false
//使用swiper模块
Vue.use(VueAwesomeSwiper);

//注册全局组件
Vue.component("BottomNavBar",BottomNavBar)
Vue.component("TopSearch",TopSearch)
Vue.component("SingleGuess",SingleGuess)

//注册全局管道
Vue.filter("dataFormat",dataFormat);

//自定义不同分区标题显示
router.beforeEach((to, from, next) => {
  if (to.meta.title) {
      document.title = to.meta.title
  }
  next();
})

/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  store,
  components: { App },
  template: '<App/>'
})
